package com.cos.web.filter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * @author: COS
 * @time: 2021/11/17 15:10
 * @description:
 */
@WebFilter(filterName = "Filter01_tets")
public class Filter01_test implements Filter {
    //没有办法使用注入  DI

    @Override
    public void destroy() {
    }

    @Override
    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
        //进入Controller之前
        chain.doFilter(req, resp);//放行
        //进入之后,返回的时候
    }

    @Override
    public void init(FilterConfig config) throws ServletException {

    }

}
